<script setup lang="ts">
const tableData = [
  { id: 1, name: '电影' },
  { id: 2, name: '电视剧' },
  { id: 3, name: '动漫' },
]
</script>

<template>
  <div class="container">
    <div class="header">
      <el-form>
        <el-form-item label="分类:">
          <el-select placeholder="Select">
            <el-option label="1" value="1" />
            <el-option label="2" value="2" />
            <el-option label="3" value="3" />
          </el-select>
        </el-form-item>

        <el-form-item label="类型:">
          <el-select placeholder="Select">
            <el-option label="1" value="1" />
            <el-option label="2" value="2" />
            <el-option label="3" value="3" />
          </el-select>
        </el-form-item>

        <el-form-item label="地区:">
          <el-select placeholder="Select">
            <el-option label="1" value="1" />
            <el-option label="2" value="2" />
            <el-option label="3" value="3" />
          </el-select>
        </el-form-item>

        <el-form-item label="年份:">
          <el-select placeholder="Select">
            <el-option label="1" value="1" />
            <el-option label="2" value="2" />
            <el-option label="3" value="3" />
          </el-select>
        </el-form-item>

        <el-form-item label=" ">
          <el-button type="primary">
            搜索
          </el-button>
          <el-button style="margin-left: 16px;">
            重置
          </el-button>
        </el-form-item>
      </el-form>
    </div>

    <div class="content">
      <el-table :data="tableData" stripe>
        <el-table-column prop="name" label="名称" />
        <el-table-column prop="name" label="分类" />
        <el-table-column prop="name" label="类型" />
        <el-table-column prop="name" label="地区" />
        <el-table-column prop="name" label="年份" />
        <el-table-column prop="name" label="主演" />
        <el-table-column prop="name" label="导演" />
        <el-table-column prop="name" label="时长" />
        <el-table-column prop="name" label="简介" />
        <el-table-column label="操作" width="160">
          <template #default>
            <el-button link type="primary">
              编辑
            </el-button>
            <el-button link type="primary">
              删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<style lang="scss" scoped>
  .container {
    position: absolute;
    inset: 20px;
    display: flex;
    flex-direction: column;
    row-gap: 20px;
  }

  .header {
    border-radius: 9px;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px 0 rgb(0 0 0 / 12%);

    :deep(.el-form) {
      display: flex;
      flex-wrap: wrap;
      gap: 20px 20px;

      .el-form-item {
        margin-bottom: 0;

        .el-form-item__label {
          width: 80px;
        }
      }

      .el-input {
        width: 240px;
      }
    }
  }

  .content {
    width: 100%;
    height: 0;
    flex: 1;
    border-radius: 9px;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px 0 rgb(0 0 0 / 12%);

    .el-table {
      height: calc(100%);
    }
  }
</style>
